class Singeton(object):
    def __init__(self):
        pass

    @classmethod
    def new_instance(cls,*args,**kwargs):
        """
        生成单例对象
        :return:
        """
        # 判断Singleton中是否有属性或者方法:_instance.如果有返回true
        # 如果没有返回false
        # 反射!!!!
        if not hasattr(Singeton,"_instance"):
            Singeton._instance = Singeton(*args,**kwargs)

        return Singeton._instance

s1 = Singeton.new_instance()
s2 = Singeton.new_instance()
s3 = Singeton.new_instance()

print(id(s1))
print(id(s2))
print(id(s3))